import request from '@/utils/request'

export function AddUser(data) {
  return request({
    url: '/shike3k/allUser/addUser',
    method: 'post',
    data
  })
}

export function getAllUser(currentPage,pageSize) {
  // console.log(typeof currentPage,pageSize)
  return request({
    url: '/shike3k/allUser/getAllUsers/'+currentPage+'/'+pageSize,
    method: 'get'
    // params:{currentPage,pageSize}
  })
}

export function DelUser(userId) {
  return request({
    url: '/shike3k/allUser/deleteUser/'+userId,
    method: 'post'
    // params:{userId}
  })
}

export function getAllRegion(currentPage,pageSize) {
  return request({
    url: '/shike3k/allArea/getAllAreas/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

// 过滤接口
export function searchUserByUsername(currentPage,pageSize,userName) {
  return request({
    url: '/shike3k/allUser/getUserByUserName/'+userName+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

export function searchUserByRegion(currentPage,pageSize,areaName) {
  return request({
    url: '/shike3k/allUser/getUserByAreaName/'+areaName+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

export function searchUserByPhone(currentPage,pageSize,phone) {
  return request({
    url: '/shike3k/allUser/getUserByPhone/'+phone+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

export function searchUserByEmail(currentPage,pageSize,email) {
  return request({
    url: '/shike3k/allUser/getUserByEmail/'+email+'/'+currentPage+'/'+pageSize,
    method: 'get'
  })
}

// 编辑用户接口
export function ReviseUser(userId,data) {
  return request({
    url: '/shike3k/allUser/modifyUser/'+userId,
    method: 'post',
    data
  })
}